package ee.ut.math.chess.hadoop.dummy.fast;

import ee.ut.math.chess.base.model.Move;
import ee.ut.math.chess.game.model.Game;
import ee.ut.math.chess.hadoop.HadoopManager;

public class DummyHadoopManagerFast extends HadoopManager{
    public static void doComputerMove(final Game game) {
        threadPool.execute(new Runnable() {

            public void run() {
                try {
                    System.out.println("Hadoop thinking1");
                    Thread.sleep((long) (Math.random()*1000 + 500));
                    
                    DummySkeletonFast skeleton = new DummySkeletonFast();
                    Move move = skeleton.getMove(game);

                    System.out.println("Hadoop moving");
                    game.move(move);

                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });
    }
}
